package com.zjp.dataFormat.service;

import cn.hutool.core.util.RandomUtil;
import com.zjp.dataFormat.pojo.Order;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class OrderService {


    public List<Order> listOrder(int size) {
        List<Order> list = new ArrayList<>(size);
        for (int i = 0; i < size; i++) {
            list.add(initOrder());
        }
        return list;
    }

    public Order initOrder() {
        Order order = new Order();
        order.setOrderName(RandomUtil.randomString(5));
        order.setOrderId(RandomUtil.randomLong(1, 99999L));
        order.setUserId(RandomUtil.randomLong(1, 11));
        return order;
    }
}
